package unit10;

import javax.swing.*;
import java.awt.*;

public class Ex10_5_CardLayoutTest extends JFrame {
    public Ex10_5_CardLayoutTest() {
        Container container = getContentPane();
        CardLayout layout = new CardLayout();
        container.setLayout(layout);
        container.add(new JButton("¿¨Æ¬Ò»"), "card1");
        container.add(new JButton("¿¨Æ¬¶þ"), "card2");
        container.add(new JButton("¿¨Æ¬Èý"), "card3");
        layout.show(container, "card2");
    }

    public static void main(String[] args) {
        Ex10_5_CardLayoutTest frame = new Ex10_5_CardLayoutTest();
        frame.setTitle("Show CardLayout");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(200, 200);
        frame.setVisible(true);
    }
}
